//
//  DBGlucose.h
//  CareRingApp
//
//  Created  on 2025/2/11.
//
    

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, GLU_RISK_LEV) {
    G_RSK_NORISK = 0, // 最低风险
    G_RSK_MAY,  // 可能有风险
    G_RSK_MIDIUM, // 中
    G_RSK_HIGH, // 高风险
};

NS_ASSUME_NONNULL_BEGIN

@interface DmdbGlucose : NSObject

@property(strong, nonatomic) NSString *account;
@property(strong, nonatomic) NSNumber *start_time, *end_time;// Measurement start and end time. Round to integer

@property(strong, nonatomic) NSString *formatTimeDay; //end_time formatted as yyyy-MM-dd
@property(strong, nonatomic) NSString *formatTimeSec; //end_time formatted as yyyy-MM-dd HH:mm:ss

@property(strong, nonatomic) NSNumber * lower_bound , * upper_bound;
@property(strong, nonatomic) NSNumber * current_level; // GLU_RISK_LEV

@property(strong, nonatomic) NSString *risk_code; // "RISK000"

@property(assign, nonatomic) BOOL within_2hrs_meal; //Two hours after a meal
@property(assign, nonatomic) BOOL fasting; // Whether fasting for 8 hours

@property(assign, nonatomic) BOOL family_history; //Family history of diabetes
@property(assign, nonatomic) BOOL high_cholesterol; //Family history of high cholesterol


// 解析从服务器返回的结果并赋值本地
-(BOOL)parseFromNetDict:(NSDictionary *)dict;

-(BOOL)isNormal; // 结果是否正常

-(UIColor *)riskColor;
+(UIColor *)colorWithRisk:(int)current_level;

-(NSString *)riskTitle;
+(NSString *)titleWithRisk:(int)current_level;

-(NSString *)meaTimeTypeString;

// glu_risk_1
-(NSString *)riskIconName;
+(NSString *)iconNameWithRisk:(int)current_level;

-(NSString *)riskTip;
-(NSString *)riskInsight;

@end

NS_ASSUME_NONNULL_END
